export type Key = React.Key;

export type FixedType = 'left' | 'right' | boolean;
export type AlignType = 'left' | 'center' | 'right';
export type DataIndex = string | number;
// export interface RenderedCell<RecordType> {
//   props?: CellType<RecordType>;
//   children?: React.ReactNode;
// }
interface ColumnSharedType<RecordType> {
  title?: React.ReactNode;
  key?: Key;
  className?: string;
  fixed?: FixedType;
  // onHeaderCell?: GetComponentProps<ColumnsType<RecordType>[number]>;
  // ellipsis?: CellEllipsisType;
  align?: AlignType;
}

export interface ColumnType<RecordType> extends ColumnSharedType<RecordType> {
  colSpan?: number;
  dataIndex?: DataIndex;
  render?: (value: any, record: RecordType, index: number) => React.ReactNode;
  shouldCellUpdate?: (record: RecordType, prevRecord: RecordType) => boolean;
  rowSpan?: number;
  width?: number | string;
  // onCell?: GetComponentProps<RecordType>;
  /** @deprecated Please use `onCell` instead */
  onCellClick?: (record: RecordType, e: React.MouseEvent<HTMLElement>) => void;
}
